because it uses FD_ISSET(-1,xxx). Since the code is written that any
ring/tty handler can set d->tty_fd to -1 it has to be checked
_every_time_.
Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
FD_ISSET(xc_evtchn_fd(d->xce_handle), &readfds))
handle_ring_read(d);
- if (d->tty_fd != -1) {
- if (FD_ISSET(d->tty_fd, &readfds))
- handle_tty_read(d);
+ if (d->tty_fd != -1 && FD_ISSET(d->tty_fd, &readfds))
+ handle_tty_read(d);
- if (FD_ISSET(d->tty_fd, &writefds))
- handle_tty_write(d);
+ if (d->tty_fd != -1 && FD_ISSET(d->tty_fd, &writefds))
+ handle_tty_write(d);
- if (d->is_dead)
- cleanup_domain(d);
- }
+ if (d->is_dead)
+ cleanup_domain(d);
}
} while (ret > -1);
}